﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HF.Framework;
using HF.Business.OA;

public partial class BaseUserControls_cpClock : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.btnCheckIn.Text = "上班签到";
        this.btnCheckOut.Text = "下班签退";
    }
    protected void btnCheck_Click(object sender, EventArgs e)
    {
        //HR_CheckIO hrc = new HR_CheckIO();
        //hrc.Account =this.Page.User.Identity.Name;
        //hrc.IP = GetIp();
        //hrc.Insert();
        //txtStatus.Text = "上班签到：正常";

    }
    /// <summary>
    /// 获取用户登录IP
    /// </summary>
    /// <returns></returns>

    private string GetIp()
    {

        //可以透过代理服务器

        string userIP = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

        if (userIP == null || userIP == "")
        {

            //没有代理服务器,如果有代理服务器获取的是代理服务器的IP

            userIP = Request.ServerVariables["REMOTE_ADDR"];

        }

        return userIP;

    }


    protected void btnCheckOut_Click(object sender, EventArgs e)
    {
        //HR_CheckIO hrc = new HR_CheckIO();
        //hrc.Account = this.Page.User.Identity.Name;
        //hrc.IP = GetIp();
        //hrc.Insert();
        //txtStatus.Text = "下班签退：正常";

    }
    protected void txtStatus_TextChanged(object sender, EventArgs e)
    {

    }
}
